import 'package:dio/dio.dart';
import 'package:library_base/utils/sp_util.dart';

class AddHeaderIntercept extends Interceptor {
  @override
  void onRequest(RequestOptions options, RequestInterceptorHandler handler) {
    if (SPUtil.token.isNotEmpty) {
      options.headers["Authorization"] = "Bearer ${SPUtil.token}";
    }
    options.headers["tenant-id"] = "1";
    super.onRequest(options, handler);
  }
}
